home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) 1992 by AT&T Bell Laboratories. */
- /* Advanced C++ Programming Styles and Idioms */
- /* James O. Coplien */
- /* All rights reserved. */
-
- class Telephone {
- public:
- void ring();
- Bool isOnHook() isTalking(), isDialing();
- DigitString collectDigits();
- LineNumber extension();
- ~Telephone();
- protected:
- Telephone();
- LineNumber extensionData;
- };
-
- class POTSPhone : public Telephone {
- public:
- Bool runDiagnostics();
- POTSPhone();
- POTSPhone(POTSPhone&);
- ~POTSPhone();
- private:
- Frame frameNumberVal;
- Rack rackNumberVal;
- Pair pairVal;
- };
-
- class ISDNPhone : public Telephone {
- public:
- ISDNPhone();
- ISDNPhone(ISDNPhone&);
- ~ISDNPhone();
- void sendBPacket(), sendDPacket();
- private:
- Channel b1, b2, d;
- };
-
- class OperatorPhone : public ISDNPhone {
- public:
- OperatorPhone();
- OperatorPhone(OperatorPhone&);
- ~OperatorPhone();
- void ring(); // special ringing needed for operator
- };
-
- class PrincessPhone : public POTSPhone {
- . . . .
- };
-